/*
 * wrote  this as a shortcut to add audio files. it takes one string
 * as a parameter - the path to the file.  
 */

package x;

/**
 *
 * @author Omar
 */
import java.applet.*;
import java.net.*;


	public class Sound{

 private AudioClip clip;
 private URL Path; 


  Sound(String location)
  {
 	 try {
    Path = new URL("file:"+location);
    clip = Applet.newAudioClip(Path); // load the Sound
 	 }catch(Exception d){
         System.out.println("Error loading sound: " + d);}
  }


  public void loop()
  {
 	 clip.loop(); // loop
  }
  public void stop()
  {
 	 clip.stop(); // stop
  }
  public void play()
  {
 	 clip.play(); // play once
  }

  
	}
	
